home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_IS_EQUAL
-
- creation {ANY}
- make
-
- feature {ANY}
-
- make is
- local
- animal1, animal2: ANIMAL;
- p1, p2: POINT;
- t1, t2: TRIANGLE;
- any1, any2: ANY;
- cp1, cp2: COLORED_POINT;
- do
- is_true(("foo").is_equal("foo"));
- is_true(not ("bar").is_equal("foo"));
- is_true(not ("foo").is_equal(""));
-
- !DOG!animal1;
- !CAT!animal1;
- !CAT!animal2;
- is_true(animal1.is_equal(animal2));
-
- !!p1.make(1.5,2.5);
- !!p2.make(1.5,2.5);
- is_true(p1.is_equal(p2));
- is_true(p2.is_equal(p1));
-
- any1 := p1;
- any2 := p2;
- is_true(any1.is_equal(any2));
- is_true(any2.is_equal(any1));
-
- !!cp1.make(1.5,2.5,"red");
- !!cp2.make(1.5,2.5,"red");
- is_true(not cp1.is_equal(cp2));
-
- any1 := cp1;
- any2 := cp1;
- is_true(any1.is_equal(any2));
- any2 := cp2;
- is_true(not any1.is_equal(any2));
-
- end;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_IS_EQUAL: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- -- std_output.put_string("Yes %N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_IS_EQUAL
-